import utils from '@/lib/utils'
import _config from '@/constant/config'

export default {
  components: {
    InputItem: require('./component/input'),
    SelectItem: require('./component/select'),
    ListItem: require('./component/list'),
  },
  data(){
    return {
      genderDist: _config.GENDER_DIST,
      positionDist: _config.POSITION_DIST
    }
  },
  // methods: {
  //   catchValue(payload){
  //     this.formInfo[payload.key] = payload.value
  //   },
  //   checkAndSubmit(){
  //     let form = this.formInfo
  //     for(let k in form){
  //       let val = form[k]
  //       if(val instanceof Error){
  //         utils.toast('请检查信息是否正确填写')
  //         return
  //       } else if(val === ''){
  //         utils.toast('请完整填写表单的各项内容')
  //         return
  //       }
  //     }
  //     form.position = this.positionDist[form.position].id
  //     form.gender = this.genderDist[form.gender].id
  //     this.$emit('submitForm', form)
  //   }
  // }
}
